package com.mew.lobby.handler.user;


import com.mew.common.rest.bo.MewSession;
import com.mew.common.rest.user.VipInfoMessage;
import com.mew.lobby.annotation.LobbyHandler;
import com.mew.lobby.net.LobbyHandlerMapCmdType;
import com.mew.lobby.net.MewHandler;
import com.mew.lobby.provide.UserFeignService;
import com.zebra.remoting.config.EmptyMessage;
import com.zebra.remoting.protocol.ZebraCommand;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
@LobbyHandler(LobbyHandlerMapCmdType.VipInfo)
public class VipInfoHandler implements MewHandler<EmptyMessage> {

    @Autowired
    private UserFeignService userFeignService;

    @Override
    public void handle(ZebraCommand<EmptyMessage> zebraCommand, MewSession session) {
        VipInfoMessage message = userFeignService.vip(zebraCommand.getUserId());
        zebraCommand.sendMessage(message);
    }
}
